package org.dromara.vehicle.modules.driver.domain.vo;

import cn.hutool.core.date.DatePattern;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.vehicle.modules.driver.domain.DriverBasicInfo;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;


/**
 * 驾驶员基本信息视图对象 driver_basic_info
 *
 * @author ckk
 * @date 2025-06-24
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = DriverBasicInfo.class)
public class DriverBasicInfoVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @ExcelProperty(value = "主键ID")
    private Long id;

    /**
     * 驾驶员用户Id
     */
    private Long driverUserId;

    /**
     * 姓名
     */
    @ExcelProperty(value = "姓名")
    private String name;

    /**
     * 性别
     */
    @ExcelProperty(value = "性别", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "sys_user_sex")
    private String gender;

    /**
     * 性别
     */
    @Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "gender", other = "sys_user_sex")
    private String genderName;

    /**
     * 身份证号
     */
    @ExcelProperty(value = "身份证号")
    private String idNumber;

    /**
     * 联系方式
     */
    @ExcelProperty(value = "联系方式")
    private String contactPhone;

    /**
     * 驾驶证号
     */
    @ExcelProperty(value = "驾驶证号")
    private String licenseNumber;

    /**
     * 准驾车型
     */
    @ExcelProperty(value = "准驾车型", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "zjcx")
    private String licenseType;

    /**
     * 准驾车型
     */
    @Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "licenseType", other = "zjcx")
    private String licenseTypeName;

    /**
     * 驾驶证有效期止
     */
    @ExcelProperty(value = "驾驶证有效期止")
    private Date expirationDate;

    /**
     * 备注
     */
    @ExcelProperty(value = "备注")
    private String remarks;

    /**
     * 驾驶证有效期状态（0：正常，1：临期（一个月内），2：超期）
     */
    private Integer expirationDateStatus;

    /**
     * 剩余分数
     */
    @ExcelProperty(value = "剩余分数")
    private Integer surplusScore;

    /**
     * 最新违章日期
     */
    @ExcelProperty(value = "最新违章日期")
    @JsonFormat(pattern = DatePattern.NORM_DATE_PATTERN)
    private Date latestViolationDate;

    /**
     * 最新培训日期
     */
    @ExcelProperty(value = "最新培训日期")
    @JsonFormat(pattern = DatePattern.NORM_DATE_PATTERN)
    private Date latestTrainingDate;

    /**
     * 违章记录
     */
    private List<DriverViolationRecordVo> violationRecords;

    /**
     * 培训记录
     */
    private List<DriverTrainingRecordVo> trainingRecords;
}
